@layer components {
  .comments {
    --avatar-size: 2.33em;
    --comment-padding-block: var(--block-space-half);
    --comment-padding-inline: var(--inline-space-double);
    --comment-max: 70ch;
    --reaction-size: 1.6875rem;

    display: flex;
    flex-direction: column;
    padding-inline: var(--inline-space);
    place-items: center;
    text-align: center;

    @media (min-width: 160ch) {
      padding-inline: var(--tray-size);
    }
  }

  .comments__subscribers {
    max-inline-size: var(--comment-max);
    padding-inline: calc(var(--comment-padding-block) + var(--inline-space-double));
  }

  .comment {
    margin-inline: auto;
    max-inline-size: var(--comment-max);
    position: relative;

    house-md-toolbar {
      margin-block-start: calc(var(--comment-padding-block) * -0.5);
    }

    .house-md-content {
      padding: var(--comment-padding-block) 0 0;
    }
  }

  .comment__author {
    .btn {
      font-weight: inherit;
    }
  }

  .comment__avatar {
    margin: calc(var(--comment-padding-block) * 0.75) calc(var(--comment-padding-inline) * -0.75);
    z-index: 0;
  }

  .comment__body {
    padding-inline-end: var(--reaction-size);
    text-align: start;

    .action-text-content {
      > action-text-attachment:first-child figure {
        margin-block-start: 0.5ch;
      }

      > :last-child {
        margin-block-end: 0;
      }
    }
  }

  .comment__content {
    --btn-icon-size: 1.2rem;
    --btn-size: var(--reaction-size);
    --comment-bg-color: var(--color-ink-lightest);
    --lexxy-bg-color: var(--comment-bg-color);

    background-color: var(--comment-bg-color);
    border-radius: 0.2em;
    padding:
      var(--comment-padding-block)
      calc(var(--comment-padding-inline) / 2)
      calc(var(--comment-padding-block) * 1.5)
      var(--comment-padding-inline);
    word-wrap: break-word;
  }

  .comment__edit {
    background-color: var(--color-ink-lightest);
  }

  .comment--system {
    --comment-padding-block: var(--block-space-half);

    max-inline-size: var(--comment-max);
    text-align: center;

    &::before {
      /* Make up space for lack of avatar */
      content: "";
      display: flex;
      inline-size: calc(var(--comment-padding-inline) * 0.75);
    }

    .comment__avatar {
      display: none;
    }

    .comment__author {
      a {
        margin: 0 auto;
      }

      h3 {
        margin-inline: auto;
      }

      strong {
        display: none;
      }
    }

    .comment__body {
      padding: 0;
      text-align: center;
    }

    .comment__content {
      background-image: repeating-linear-gradient(
        45deg in srgb,
        var(--color-canvas) 0 1px,
        var(--color-ink-lightest) 1px 10px
      );
      padding-inline: var(--comment-padding-inline);
    }

    .reactions {
      display: none !important;
    }
  }
}
